import axios from "axios";

// 创建实例
const http = axios.create({
  //设置基准地址
  baseURL: "http://localhost:3004",
  timeout: 10000, //超时时间
  withCredentials: false, // 确保这是 false 或移除
});
// request 请求拦截器
http.interceptors.request.use(
  config => {
    return config;
  },
  error => {
    return Promise.reject(error);
  },
);

// response响应拦截器
http.interceptors.response.use(
  async config => {
    return config;
  },
  error => {
    return Promise.reject(error);
  },
);

export default http;
